﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BranksEdit.aspx.cs" Inherits="CNVP.JShop.Web.Admin.BranksEdit" ValidateRequest="false" %>

<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>
<%@ Register assembly="CNVP.Framework" namespace="CNVP.Framework.UploadFile" tagprefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
            <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="IE=7" http-equiv="X-UA-Compatible" />
    <link href="CSS/Edit.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery.js" type="text/javascript"></script>
    <script src="../Scripts/Common.js" type="text/javascript"></script>
     <script type ="text/javascript">
         $(function () {
             $("#btUp").click(function () {
                 var $txtBrankName = $("#txtBrankName");
                 if ($txtBrankName.val() == "") {
                     alert("请输入品牌名称！");
                     $txtBrankName.focus();
                     return false;
                 }
                 var $txtBrankAddress = $("#txtBrankAddress");
                 if ($txtBrankAddress.val() != "http://") {
                     if (!IsValidURL($txtBrankAddress.val())) {
                         alert("官方网站格式不正确！");
                         $txtBrankAddress.focus();
                         return false;
                     }
                 }
                 var $txtOrderID = $("#txtOrderID");
                 if ($txtOrderID.val() == "") {
                     alert("请输入排序！");
                     $txtOrderID.focus();
                     return false;
                 }
                 else if (!IsInteger($txtOrderID.val())) {
                     alert("排序格式不正确！");
                     $txtOrderID.focus();
                     return false;
                 }
             });
         })
         function ChangeBox(obj) {
             if ($(obj).attr("checked") == "checked") {
                 $(".LocalUrl").css("display", "none");
                 $(".WebUrl").css("display", "");
             }
             else {
                 $(".WebUrl").css("display", "none");
                 $(".LocalUrl").css("display", "");             
             }
         }
   </script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="Content">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="cell">
                <tr>
                    <td class="cell_group">
                        <img src="Images/ListIconTitle.jpg" alt="" />&nbsp;您的位置：<a href="BranksList.aspx">品牌管理</a><asp:Label ID="lbTitle" runat="server"></asp:Label>
                    </td>
                </tr>
            </table>
                    <table border="0" cellpadding="0" cellspacing="0" class="division">
                        <tr>
                            <th>
                                 品牌名称:</th>
                            <td>
                                 <asp:TextBox ID="txtBrankName" runat="server" MaxLength="50"/>
                                </td>
                        </tr>
                        <tr>
                            <th>
                                 官方网站:</th>
                            <td>
                                 <asp:TextBox ID="txtBrankAddress" runat="server" MaxLength="50" Text="http://" />
                                </td>
                        </tr>
                        <tr>
                            <th>品牌Logo:</th>
                            <td><input type="checkbox" name="isWebUrl" value="1" onclick="ChangeBox(this)" />使用网络地址
                            <br />
                            <div class="LocalUrl">
                             <cc1:Upload ID="fileUp" runat="server" UploadType="Branks"></cc1:Upload>(只允许上传后缀名为gif、jpg和png的图片)
                            </div>
                            <div class="WebUrl" style="display:none;">
                            <asp:TextBox ID="txtWebUrl" runat="server" MaxLength="50" Text="http://" />
                            </div>
                                 <br />
                                 <asp:Image ID="imgPic" runat="server" Visible="false" />
                                </td>
                        </tr>
                        <tr>
                            <th>
                                 排序序号:</th>
                            <td>
                               <asp:TextBox ID="txtOrderID" runat="server" MaxLength="50" Text="0" />
                                </td>
                        </tr>
                        <tr>
                            <th>
                                 品牌别名:</th>
                            <td>
                                 <asp:TextBox ID="txtBrankOtherName" runat="server"  MaxLength="50" />
                                </td>
                        </tr>
                        </table>
                        <h3 onclick="IsShowFCK()">品牌描述(<font color="red" style="cursor:pointer">打开请点击</font>)</h3>
                                    <table border="0" cellpadding="0" cellspacing="0" class="division" >
                                        <tbody id="divisionFCKeditor" style=" display:none;">
                                        <tr>
                                            <td>
                                                    <FCKeditorV2:FCKeditor ID="txtBrankDetail" runat="server" Height="500px">
                                                    </FCKeditorV2:FCKeditor>

                                                </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                <asp:CheckBox ID="cbFCKeditorIsShow" runat="server" CssClass="Display" />
                                <script type="text/javascript">
                                    function IsShowFCK() {
                                        var cbFCKeditorIsShow = document.getElementById("cbFCKeditorIsShow");
                                        if (cbFCKeditorIsShow.checked == true) {
                                            cbFCKeditorIsShow.checked = false;
                                            $("#divisionFCKeditor").css("display", "none");
                                        }
                                        else {
                                            cbFCKeditorIsShow.checked = true;
                                            $("#divisionFCKeditor").css("display", "");
                                        }
                                    }
                                </script>
                            <div class="EditBtn">     
                                <asp:Button ID="btUp" runat="server" Text="提交" OnClick="btUp_Click" />
                                <input type="button" value="取消" onclick="javascript:history.go(-1)" />
                                </div>
        </div>
        <script type="text/javascript">
            ImgSize("#imgPic", 400, 300);
      </script>
    </form>
</body>
</html>

